@layout("/common/_container.html"){
<style>
    .pay_list_c1 {
        display: inline-block;
        width: 15px;
        height: 15px;
        background: #DCDCDC;
        border: 1px solid #535353;
        border-radius: 5px;
        vertical-align: middle
    }
    .radioclass {
        opacity: 0;
        cursor: pointer;
        -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
        filter: alpha(opacity=0);
    }
</style>

<div style="display: none">
    <input type="hidden" id="customerIdValue" value="${customerId}">
</div>

<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div id="departmentBox" class="clearfix">

        </div>
        <div>
            <button class="btn" type="button" id="submission">提交</button>
        </div>
    </div>
</div>


<script>
    $(function () {
        $.post(Feng.ctxPath + "/payService/getList", function (data) {
            var txt = '';
            data.forEach(function (key, value) {
                console.log(key.department);
                console.log(value+"22222");
                txt += '<div class="col-sm-2" style="padding: 0;">' +
                    '<span class="pay_list_c1 projectDatas">' +
                    '<input class="radioclass" type="radio" name="about" value="' + key.department + '" id="click_' + value + '">' +
                    '</span><label class="projectData" for="click_' + value + '" style="font-weight: 500;margin-left: 10px;">' + key.department + '</label></div>'
            });
            document.getElementById('departmentBox').innerHTML = txt;
        }, "json");
    });

    $("#departmentBox").on('click', '.projectDatas', function () {
        $(this).parent().parent().find(".pay_list_c1").css("background", "#DCDCDC")
        $(this).css("background", "#289bd6")
    });
    $("#departmentBox").on('click', '.projectData', function () {
        $(this).parent().parent().find(".pay_list_c1").css("background", "#DCDCDC")
        $(this).siblings().css("background", "#289bd6")
    });
       
    $("#submission").click(function () {
        var customerId = $("#customerIdValue").val();
        var appointmentPayService = $("input[name='about']:checked").val();
        $.ajax({
            url: Feng.ctxPath +"/customer/choiceAppointment",
            type:'POST',
            data:{
                customerId:customerId,
                appointmentPayService:appointmentPayService
            },
            success:function (data) {
                Feng.success("保存成功!");
                window.parent.Customer.table.refresh();
                parent.layer.close(parent.layer.getFrameIndex(window.name));
            },
            error:function (data) {
                alert("系统故障！")
            }
        })
    })
    


</script>
@}
